home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / GX Libraries / GraphicsLibraries.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-07  |  20.6 KB  |  462 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        GraphicsLibraries.h
  3.  
  4.     Contains:    graphics libraries - general library interfaces
  5.  
  6.     Written by:    Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>      4/7/95    jtd        changed 'fract' to 'Fract'
  13.          <2>      1/9/95    JD        changed 'boolean' to 'Boolean'
  14.          <1>      1/9/95    JD        First checked in.
  15. */
  16.  
  17. #ifndef __GRAPHICSLIBRARIES__
  18. #define __GRAPHICSLIBRARIES__
  19.  
  20. #include <GXTypes.h>
  21. #include <GXMath.h>
  22. #include <GXGraphics.h>
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. /* for compatibility with old headers */
  29. #define graphicsLibrariesIncludes
  30.  
  31. /*    We use “if( a ) b; else” instead of “{ if (a ) b; }” because the first one can be used in an if-else
  32.     statement and the second one can’t (due to the “;” at the end of the macro instance. */
  33.  
  34. #define NilShapeReturn(a)            if ((a) == (gxShape) nil) {GXPostGraphicsError(shape_is_nil); return; } else
  35. #define NilShapeReturnNil(a)        if ((a) == (gxShape) nil) {GXPostGraphicsError(shape_is_nil); return 0L; } else
  36. #define NilStyleReturn(a)            if ((a) == (gxStyle) nil) {GXPostGraphicsError(style_is_nil); return; } else
  37. #define NilStyleReturnNil(a)        if ((a) == (gxStyle) nil) {GXPostGraphicsError(style_is_nil); return 0L; } else
  38. #define NilInkReturn(a)            if ((a) == (gxInk) nil) {GXPostGraphicsError(ink_is_nil); return; } else
  39. #define NilInkReturnNil(a)            if ((a) == (gxInk) nil) {GXPostGraphicsError(ink_is_nil); return 0L; } else
  40. #define NilTransformReturn(a)        if ((a) == (gxTransform) nil) {GXPostGraphicsError(transform_is_nil); return; } else
  41. #define NilTransformReturnNil(a)    if ((a) == (gxTransform) nil) {GXPostGraphicsError(transform_is_nil); return 0L; } else
  42. #define NilColorSetReturn(a)        if ((a) == (gxColorSet) nil) {GXPostGraphicsError(colorSet_is_nil); return; } else
  43. #define NilColorSetReturnNil(a)        if ((a) == (gxColorSet) nil) {GXPostGraphicsError(colorSet_is_nil); return 0L; } else
  44. #define NilColorProfileReturn(a)    if ((a) == (gxColorProfile) nil) {GXPostGraphicsError(colorProfile_is_nil); return; } else
  45. #define NilColorProfileReturnNil(a)    if ((a) == (gxColorProfile) nil) {GXPostGraphicsError(colorProfile_is_nil); return 0L; } else
  46. #define NilTagReturn(a)            if ((a) == (gxTag) nil) {GXPostGraphicsError(tag_is_nil); return; } else
  47. #define NilTagReturnNil(a)        if ((a) == (gxTag) nil) {GXPostGraphicsError(tag_is_nil); return 0L; } else
  48.  
  49. #ifdef debugging
  50.     /* just in case the application (or the graphics system) redefined these to something weird... */
  51.     #undef DebugStr
  52.     #undef IfDebug
  53.  
  54.     #define IfDebug(a, b)                if (a) DebugStr(b); else
  55.     #define IfDebugReturn(a, b)        if (a) { DebugStr(b); return; } else
  56.     #define IfDebugReturnNil(a, b)        if (a) { DebugStr(b); return 0L; } else
  57.     #define NilParamReturn(a)        if ((a) == 0L) {GXPostGraphicsError(parameter_is_nil); return; } else
  58.     #define NilParamReturnNil(a)        if ((a) == 0L) {GXPostGraphicsError(parameter_is_nil); return 0L; } else
  59.     #define IfErrorReturn(a,b)        if (a) { GXPostGraphicsError(b); return; } else
  60.     #define IfErrorReturnNil(a,b)        if (a) { GXPostGraphicsError(b); return 0L; } else
  61.     #define IfNotice(a, b)            if (a) GXPostGraphicsNotice(b); else
  62.     #define IfWarning(a,b)            if (a) GXPostGraphicsWarning(b); else
  63.     #define IfWarningReturn(a,b)        if (a) { GXPostGraphicsWarning(b); return; } else
  64.     #define IfWarningReturnNil(a,b)    if (a) { GXPostGraphicsWarning(b); return 0L; } else
  65. #else
  66.     #define IfDebug(a, b)
  67.     #define IfDebugReturn(a, b)
  68.     #define IfDebugReturnNil(a, b)
  69.     #define NilParamReturn(a)
  70.     #define NilParamReturnNil(a)
  71.     #define IfErrorReturn(a,b)
  72.     #define IfErrorReturnNil(a,b)
  73.     #define IfNotice(a, b)
  74.     #define IfWarning(a,b)
  75.     #define IfWarningReturn(a,b)        if (a) return; else
  76.     #define IfWarningReturnNil(a,b) if (a) return 0L; else
  77. #endif
  78.  
  79.  
  80. enum commonColors {
  81.     /* common color names */
  82.     gxWhite = 1,        gxBlack,                gxGray,                gxGrey = gxGray,
  83. #ifndef __QUICKDRAW__
  84.     white = 1,            black,                gray,                grey = gray,
  85. #endif
  86.         /* primaries */
  87.     red,                green,                blue,
  88.         /* secondaries */
  89.     cyan,            magenta,                yellow,
  90.         /* tertiaries */
  91.     orange,            chartreuse,            aqua,                teal = aqua,
  92.     slate,            purple,                violet = purple,            maroon,
  93.         /* others */
  94.     brown,            pink,                    turquoise,
  95.     cadmium_lemon,    cadmium_light_yellow,    aureoline_yellow,        naples_deep_yellow,
  96.     cadmium_yellow,     cadmium_deep_yellow,    cadmium_orange,        cadmium_light_red,
  97.     cadmium_deep_red,    geranium_lake,            alizarin_crimson,        rose_madder,
  98.     madder_deep_lake,    brown_madder,            permanent_red_violet,    cobalt_deep_violet,
  99.     ultramarine_violet,    ultramarine_blue,        cobalt_blue,            royal_blue,
  100.     cerulean_blue,        manganese_blue,        indigo,                turquoise_blue,
  101.     emerald_green,        permanent_green,        viridian_light,            cobalt_green,
  102.     cinnabar_green,     sap_green,            chromium_oxide_green,    terre_verte,
  103.     yellow_ochre,        mars_yellow,            raw_sienna,            mars_orange,
  104.     gold_ochre,        brown_ochre,            deep_ochre,            burnt_umber,
  105.     burnt_sienna,        flesh,                flesh_ochre,            english_red,
  106.     venetian_red,        indian_red,            raw_umber,            greenish_umber,
  107.     van_dyck_brown,    sepia,                warm_grey,            cold_grey,
  108.     ivory_black,        lamp_black,            titanium_white,        zinc_white,
  109.     pale_gold,            gold,                    old_gold,                pink_gold,
  110.     white_gold,        yellow_gold,            green_gold,            platinum,
  111.     silver,            antique_silver,            chrome,                steel,
  112.     copper,            antique_copper,        oxidized_copper,        bronze,
  113.     brass,            iron,                    rusted_iron,            lead,
  114.     fluorescent_pink,    fluorescent_green,        fluorescent_blue,
  115.     incadescent_high,    incadescent_low,
  116.     moonlight,            sodium,                daylight,                dawn,
  117.     afternoon,            dusk,
  118.     mauve,
  119.     apple_green,        apple_yellow,            apple_orange,            apple_red,
  120.     apple_purple,        apple_blue,
  121.  
  122.     /* common color modifiers */
  123.     light = 512,
  124.     dark = 1024,
  125.     warm = 2048,
  126.     reddish = warm,
  127.     cool = 4096,
  128.     bluish = cool,
  129.     grayish = 8192,
  130.     whitish = light,
  131.     blackish = dark,
  132.     greenish = 16384
  133. };
  134.  
  135. typedef long commonColor;
  136.  
  137. extern gxColorSet commonColorSet;
  138. extern gxSetColor commonColorList[];
  139. extern short commonColorCount;
  140.  
  141. /* some very useful constructive definitions for creating colors */
  142. /* see 'color library.c' for an example of their use... */
  143.  
  144. #define makeRGBSHORT(a,b,c) ((c >> 14) + ((b >> 13) + (a >> 13) << 3) << 3)
  145. #define makeCMYKSHORT(a,b,c,d) ((d >> 14) + ((c >> 14) + ((b >> 14) + (a >> 14) << 2) << 2) << 2)
  146. #define makeRGB16(a,b,c) ((c >> 11) + ((b >> 11) + (a >> 11) << 5) << 5)
  147. #define makeCMYK16(a,b,c,d) ((d >> 12) + ((c >> 12) + ((b >> 12) + (a >> 12) << 4) << 4) << 4)
  148. #define xRGB256(a,b,c) {gxRGBSpace,nil,{(a << 8)+a,(b << 8)+b,(c << 8)+c, 0 }}
  149.  
  150. #define xRGB(a,b,c)    {gxRGBSpace,nil,{a,b,c,0}}
  151. #define xCMYK(a,b,c,d) {gxCMYKSpace,nil,{a,b,c,d}}
  152. #define xHSV(a,b,c) {gxHSVSpace,nil,{a,b,c,0}}
  153. #define xCIE(a,b,c) {gxCIESpace,nil,{a,b,c,0}}
  154. #define xYIQ(a,b,c) {gxYIQSpace,nil,{a,b,c,0}}
  155. #define xXYZ(a,b,c) {gxXYZSpace,nil,{a,b,c,0}}
  156. #define xLUV(a,b,c) {gxLUVSpace,nil,{a,b,c,0}}
  157. #define xLAB(a,b,c) {gxLABSpace,nil,{a,b,c,0}}
  158. #define xHLS(a,b,c) {gxHLSSpace,nil,{a,b,c,0}}
  159. #define xNTSC(a,b,c) {gxNTSCSpace,nil,{a,b,c,0}}
  160. #define xPAL(a,b,c) {gxPALSpace,nil,{a,b,c,0}}
  161. #define xGRAY(a) {gxGraySpace,nil,{a,0,0,0}}
  162. #define xRGB16(a,b,c) {gxRGB16Space,nil,{makeRGB16(a,b,c),0,0,0}}
  163. #define xRGB32(a,b,c) {gxRGB32Space,nil,{(a >> 8),((c >> 8) + (b >> 8) << 8),0,0}}
  164. #define xCMYK32(a,b,c,d) {gxCMYK32Space,nil,{((b >> 8) + (a >> 8) << 8),((d >> 8) + (c >> 8) << 8),0,0}}
  165.  
  166. #define sRGB(r,g,b) {r,g,b,0}
  167. #define sCMYK(c,m,y,k) {c,m,y,k}
  168. #define sRGB256(a,b,c) {(a << 8)+a,(b << 8)+b,(c << 8)+c, 0 }
  169.  
  170. enum commonFaces {
  171.     gxPlain,
  172.     gxBold = 1,
  173.     gxItalic = 2,
  174.     gxUnderline = 4,
  175.     gxOutline = 8,
  176.     gxShadow = 0x10,
  177.     gxCondense = 0x20,
  178.     gxExtend = 0x40,
  179.     gxLighten = 0x80
  180. };
  181.  
  182. typedef char commonFace;
  183.  
  184. enum commonTransferModes {        /* These modes simulate QuickDraw's transfer modes    */
  185.     commonAddOverMode = 2000,
  186.     commonSubtractOverMode,
  187.     commonSubtractPinMode,
  188.     commonTransparentMode,
  189.     commonInMode,
  190.     commonOutMode
  191. } ;
  192.  
  193. typedef short commonTransferMode;
  194.  
  195. struct cubic {
  196.     gxPoint a;
  197.     gxPoint b;
  198.     gxPoint c;
  199.     gxPoint d;
  200. } ;
  201. typedef struct cubic cubic;
  202.  
  203. struct conic {
  204.     gxPoint a;
  205.     gxPoint b;
  206.     gxPoint c;
  207.     Fixed lambda;
  208. };
  209. typedef struct conic conic;
  210.  
  211. /* shape library */
  212. gxShape NewPath(const gxPath *path);
  213. gxShape NewPolygon(const gxPolygon *polygon);
  214. gxPolygon *GetPolygon(gxShape source, long contour, gxPolygon *polygon);
  215. gxPath *GetPath(gxShape source, long contour, gxPath *path);
  216. void SetPath(gxShape target, long contour, const gxPath *path);
  217. void SetPolygon(gxShape target, long contour, const gxPolygon *polygon);
  218. void DrawPolygon(const gxPolygon *polygon, gxShapeFill fill);
  219. void DrawPath(const gxPath *path, gxShapeFill fill);
  220.  
  221. void SetShapeIndexPoint(gxShape target, long index, const gxPoint *point);
  222. void SetShapeIndexControl(gxShape target, long index, long control);
  223. gxPoint *GetShapeIndexPoint(gxShape source, long index, gxPoint *point);
  224. long GetShapeIndexControl(gxShape source, long index, long *control);
  225.  
  226. void InsertShape(gxShape target, long index, gxShape toAdd);
  227. gxShape ExtractShape(gxShape source, long firstPoint, long numPoints);
  228. void AddToShape(gxShape target, gxShape add);
  229. void ExtendShape(gxShape target, gxShape add);
  230.  
  231. #ifdef debugging
  232.     gxShape NewShape2(gxShapeType type, Fixed x, Fixed y);
  233.     gxShape NewShape4(gxShapeType type, Fixed firstX, Fixed firstY, Fixed lastX, Fixed lastY);
  234.     gxShape NewShape6(gxShapeType type, Fixed firstX, Fixed firstY, Fixed controlX, Fixed controlY, Fixed lastX, Fixed lastY);
  235.  
  236.     void SetShape2(gxShape target, Fixed x, Fixed y);
  237.     void SetShape4(gxShape target, Fixed firstX, Fixed firstY, Fixed lastX, Fixed lastY);
  238.     void SetShape6(gxShape target, Fixed firstX, Fixed firstY, Fixed controlX, Fixed controlY, Fixed lastX, Fixed lastY);
  239. #else
  240.     #define NewShape2(type,p1,p2)                NewShapeMany(type, (Fixed)p1, (Fixed)p2)
  241.     #define NewShape4(type,p1,p2, p3, p4)            NewShapeMany(type, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4)
  242.     #define NewShape6(type,p1,p2, p3, p4, p5, p6)    NewShapeMany(type, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4, (Fixed)p5, (Fixed)p6)
  243.  
  244.     #define SetShape2(source,p1,p2)                SetShapeMany(source, (Fixed)p1, (Fixed)p2)
  245.     #define SetShape4(source,p1,p2, p3, p4)            SetShapeMany(source, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4)
  246.     #define SetShape6(source,p1,p2, p3, p4, p5, p6)    SetShapeMany(source, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4, (Fixed)p5, (Fixed)p6)
  247. #endif
  248.  
  249. gxShape NewShapeMany(gxShapeType type, Fixed firstArg, ...);
  250. void SetShapeMany(gxShape target, Fixed firstArg, ...);
  251.  
  252. gxShape GetBitmapPartsFromFixedBounds(gxShape source, const gxRectangle *bounds);
  253. void SetBitmapPartsFromFixedBounds(gxShape target, const gxRectangle *bounds, gxShape bitmapShape);
  254.  
  255. /* arc library, oval library, roundrect library, cubic library, and conic library */
  256. gxShape NewArc(const gxRectangle *rect, Fixed startAng, Fixed sweep, Boolean wedge);
  257. gxShape NewOval(const gxRectangle *rect);
  258. gxShape NewRoundRect(const gxRectangle *rect, const gxPoint *ovalSize);
  259. gxShape NewCubic(const cubic *curve);
  260. gxShape NewConic(const conic *curve);
  261.  
  262. void DrawArc(const gxRectangle *rect, Fixed startAng, Fixed sweep, Boolean wedge);
  263. void DrawOval(const gxRectangle *rect, gxShapeFill fill);
  264. void DrawRoundRect(const gxRectangle *rect, const gxPoint *ovalSize, gxShapeFill fill);
  265. void DrawCubic(const cubic *curve, gxShapeFill fill);
  266. void DrawConic(const conic *curve, gxShapeFill fill);
  267.  
  268. void SetArc(gxShape target, const gxRectangle *rect, Fixed startAng, Fixed sweep, Boolean wedge);
  269. void SetOval(gxShape target, const gxRectangle *rect);
  270. void SetRoundRect(gxShape target, const gxRectangle *rect, const gxPoint *ovalSize);
  271. void SetCubic(gxShape target, const cubic *curve);
  272. void SetConic(gxShape target, const conic *curve);
  273.  
  274. /* graphics debug library */
  275. void SetGraphicsLibraryErrors(void);    /* set the error and warning routines */
  276. void SetGraphicsLibraryNotices(void);    /* set the notice routine */
  277. char *GraphicsErrorMessage(gxGraphicsError error);
  278. char *GraphicsWarningMessage(gxGraphicsWarning warning);
  279. char *GraphicsNoticeMessage(gxGraphicsNotice notice);
  280. void DisplayGraphicsErrorMessage(gxGraphicsError error, long reference);
  281. void DisplayGraphicsWarningMessage(gxGraphicsWarning warning, long reference);
  282. void DisplayGraphicsNoticeMessage(gxGraphicsNotice notice, long reference);
  283.  
  284. /* gxShape library */
  285. void CenterShape(gxShape target, gxRectangle *rect);
  286. void MoveShapeCenterTo(gxShape target, Fixed x, Fixed y);
  287. void RotateShapeAboutCenter(gxShape target, Fixed degrees);
  288. void SkewShapeAboutCenter(gxShape target, Fixed xSkew, Fixed ySkew);
  289. void ScaleShapeAboutCenter(gxShape target, Fixed hScale, Fixed vScale);
  290.  
  291. /* graphics library */
  292. void MapShapeToSpace(gxShape target, gxViewPort port, gxViewDevice device);
  293. void MapShapeFromSpace(gxShape target, gxViewPort port, gxViewDevice device);
  294. void MapPointToSpace(gxPoint *target, gxViewPort port, gxViewDevice device);
  295. void MapPointFromSpace(gxPoint *target, gxViewPort port, gxViewDevice device);
  296.  
  297. /* gxTransform library */
  298. gxViewPort GetTransformViewPort(gxTransform source);
  299. void SetTransformViewPort(gxTransform target, gxViewPort port);
  300. void AddToTransformViewPort(gxTransform target, gxViewPort port);
  301. void SetShapeViewPort(gxShape target, gxViewPort port);
  302. gxViewPort GetShapeViewPort(gxShape source);
  303. void SetDeepShapeViewPort(gxShape target, gxViewPort port);
  304. void SetDeepShapeViewPorts(gxShape target, long count, const gxViewPort portList[]);
  305. void SetDeepShapeTransform(gxShape target, gxTransform);
  306. void SetDefaultViewPort(gxViewPort port);
  307. gxViewGroup CopyViewGroup(gxViewGroup group);
  308. gxTransform ChangeTransformViewGroup(gxTransform target, gxViewGroup oldGroup, gxViewGroup newGroup);
  309. gxShape ChangeShapeViewGroup(gxShape source, gxViewGroup oldGroup, gxViewGroup newGroup);
  310. gxTransform SeparateShapeTransform(gxShape source);
  311. void ReuniteShapeTransform(gxShape target, gxTransform separate);
  312.  
  313. /* graphics state library */
  314. gxStyle SeparateShapeStyle(gxShape source);
  315. void ReuniteShapeStyle(gxShape target, gxStyle separate);
  316. gxInk SeparateShapeInk(gxShape source);
  317. void ReuniteShapeInk(gxShape target, gxInk separate);
  318.  
  319. /* gxShape library */
  320. void GetPathsIndexPointControl(const gxPaths *source, long index, gxPoint **pt, long **controlPtr, long *controlMask);
  321. void SetShapeOpenPath(gxShape target);
  322. void PreMapTransform(gxTransform source, gxMapping *map);
  323.  
  324. /* graphics library */
  325. #define CopyShape(s) GXCopyToShape(nil,s)
  326. #define CopyStyle(s) GXCopyToStyle(nil,s)
  327. #define CopyInk(s) GXCopyToInk(nil,s)
  328. #define CopyTransform(s) GXCopyToTransform(nil,s)
  329. void DisposeTransformAt(gxTransform *target);
  330. void DisposeShapeAt(gxShape *target);
  331. void DisposeStyleAt(gxStyle *target);
  332. void DisposeInkAt(gxInk *target);
  333. void DisposeTagAt(gxTag *target);
  334.  
  335. /* gxColor matching library */
  336. gxColorProfile CreateQMSColorProfile(void);
  337. gxColorProfile CreateCanonColorProfile(void);
  338. gxColorProfile CreateColorSyncSystemProfile(void);
  339.  
  340. /* gxColor library */
  341. void InitCommonColors(void);
  342. void DisposeCommonColors(void);
  343. void SetShapeRGB(gxShape target, gxColorValue red, gxColorValue green, gxColorValue blue);
  344. void SetInkRGB(gxInk target, gxColorValue red, gxColorValue green, gxColorValue blue);
  345. void SetShapeHSV(gxShape target, gxColorValue hue, gxColorValue saturation, gxColorValue value);
  346. void SetInkHSV(gxInk target, gxColorValue hue, gxColorValue saturation, gxColorValue value);
  347. void SetShapeGray(gxShape target, gxColorValue gray);
  348. void SetInkGray(gxInk target, gxColorValue gray);
  349.  
  350. /* gxTransferMode library, gxColor library, text library */
  351. void SetShapeCommonTransfer(gxShape target, commonTransferMode mode);
  352. void SetShapeCommonColor(gxShape target, commonColor color);
  353. void SetShapeCommonFace(gxShape target, commonFace face);
  354.  
  355. void SetInkCommonTransfer(gxInk target, commonTransferMode mode);
  356. void SetInkCommonColor(gxInk target, commonColor);
  357. void SetStyleCommonFace(gxStyle target, commonFace);
  358.  
  359. commonTransferMode GetInkCommonTransfer(gxInk source);
  360. commonColor GetInkCommonColor(gxInk source);
  361. commonFace GetStyleCommonFace(gxStyle source);
  362.  
  363. commonTransferMode GetShapeCommonTransfer(gxShape source);
  364. commonColor GetShapeCommonColor(gxShape source);
  365. commonFace GetShapeCommonFace(gxShape source);
  366.  
  367. gxColor *SetCommonColor(gxColor *target, commonColor color);
  368. commonColor GetCommonColor(const gxColor *source);
  369.  
  370. /* gxColor library */
  371. gxColorSpace GetShapeColorSpace(gxShape target);
  372. gxColorProfile GetShapeColorProfile(gxShape source);
  373. gxColorSet GetShapeColorSet(gxShape source);
  374. gxColorSpace GetInkColorSpace(gxInk target);
  375. gxColorProfile GetInkColorProfile(gxInk source);
  376. gxColorSet GetInkColorSet(gxInk source);
  377.  
  378. void SetShapeColorSpace(gxShape target, gxColorSpace space);
  379. void SetShapeColorProfile(gxShape target, gxColorProfile profile);
  380. void SetShapeColorSet(gxShape target, gxColorSet set);
  381. void SetInkColorSpace(gxInk target, gxColorSpace space);
  382. void SetInkColorProfile(gxInk target, gxColorProfile profile);
  383. void SetInkColorSet(gxInk target, gxColorSet set);
  384.  
  385. gxColorSet GetViewDeviceColorSet(gxViewDevice source);
  386. void SetViewDeviceColorSet(gxViewDevice target, gxColorSet set);
  387. gxColorProfile GetViewDeviceColorProfile(gxViewDevice source);
  388. void SetViewDeviceColorProfile(gxViewDevice target, gxColorProfile profile);
  389.  
  390. long GetColorSpaceComponents(gxColorSpace space);
  391.  
  392. /* gxTransferMode library */
  393. void InitTransferMode(gxTransferMode *mode);
  394. gxTransferMode *SetCommonTransfer(gxTransferMode *transferModeRecord, commonTransferMode mode, unsigned short opValue, const gxColor *opColor);
  395. gxColor *TransmogrifyColor(gxColor *dstColor, const gxColor *srcColor, const gxTransferMode *);
  396. void SetInkFastXorTransfer(gxInk inky, gxViewDevice destDevice, gxViewPort destViewPort, gxColor *background, gxColor *result);
  397. void SetShapeFastXorTransfer(gxShape source, gxColor *background, gxColor *result);
  398.  
  399. gxShape NewCString(const char *cString, const gxPoint *position);
  400. gxShape NewPString(const char *pascalString, const gxPoint *position);
  401. gxShape NewChar(const char theChar, const gxPoint *position);
  402. void SetCString(gxShape target, const char *cString, const gxPoint *position);
  403. void SetPString(gxShape target, const char *pascalString, const gxPoint *position);
  404. void SetChar(gxShape target, const char theChar, const gxPoint *position);
  405. void DrawCString(const char *cString, const gxPoint *position);
  406. void DrawPString(const char *pascalString, const gxPoint *position);
  407. void gDrawChar(const char theChar, const gxPoint *position);
  408.  
  409. Fixed FixTextWidth(const unsigned char *string, short length);
  410. Fixed FixCStringWidth(const char *string);
  411. Fixed FixPStringWidth(const char *string);
  412. Fixed FixCharWidth(char ch);
  413. gxPoint *GetShapeAdvance(gxShape target, gxPoint *advance);
  414.  
  415. void SetGlyphText(gxShape target, const unsigned char *text, long length);
  416. void SetGlyphAdvance(gxShape target, const long advanceBits[]);
  417. void SetGlyphStyles(gxShape target, const short styleRuns[], const gxStyle glyphStyles[]);
  418.  
  419. long GetGlyphText(gxShape source, unsigned char *text);
  420. long GetGlyphAdvance(gxShape source, long advanceBits[]);
  421. long GetGlyphStyles(gxShape source, short styleRuns[], gxStyle glyphStyles[]);
  422.  
  423. /* gxMapping library */
  424. void PolyToPolyMap(const gxPolygon *source, const gxPolygon *dest, gxMapping *mapping);
  425.  
  426. /* gxShape library */
  427. void PaintRectangle(const gxRectangle *source, commonColor color);
  428. void PaintRectangle2(const gxPoint *leftTop, const gxPoint *rightBottom, commonColor color);
  429. void PaintRectangle4(long left, long top, long right, long bottom, commonColor color);
  430.  
  431. /* picture library */
  432. void AddToPicture(gxShape picture, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  433. void InsertPictureItem(gxShape picture, long index, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  434. gxShape GetPictureItem(gxShape picture, long index, gxShape *destShape, gxStyle *destStyle, gxInk *destInk, gxTransform *destTransform);
  435. void SetPictureItem(gxShape picture, long index, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  436.  
  437. /* user library */
  438. void AddShapeUser(gxShape target, const void *data, long length, long type);
  439. long GetShapeUser(gxShape source, void *data, long *length, long requestedType, long *foundType, long index);
  440. void RemoveShapeUser(gxShape target, long type, long index);
  441.  
  442. /* ramp library */
  443. gxShape NewRamp(const gxColor *firstColor, const gxColor *lastColor, long steps, const gxRectangle *bounds);
  444. void DrawRamp(const gxColor *firstColor, const gxColor *lastColor, long steps, const gxRectangle *bounds);
  445. gxShape NewCommonRamp(commonColor firstColor, commonColor lastColor, long steps, const gxRectangle *bounds);
  446. void DrawCommonRamp(commonColor firstColor, commonColor lastColor, long steps, const gxRectangle *bounds);
  447.  
  448. /* spline library */
  449. #define circleSlack ((Fract)0x3504f334) /* if the points form a square, this slop will approximate a circle */
  450. enum { openSpline, closedSpline };    /* passed as the closed parameter */
  451. gxShape MirrorSpline(long count, gxPoint *points, Fract slack, Boolean closed);
  452.  
  453. /* framing libarary */
  454. void OutsetShape(gxShape source, Fixed distance);
  455. void FrameShape(gxShape source, Fixed distance);
  456.  
  457. #ifdef __cplusplus
  458. }
  459. #endif
  460.  
  461. #endif /* __GRAPHICSLIBRARIES__ */
  462.